package com.example.shop.order.bo;

import com.example.shop.user.dto.GoodsBuyInfo;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * 普通的计算购买金额
 */
@Data
@AllArgsConstructor
public class NormalCalculation implements Calculation{
    /**
     * 购买的信息
     */
    private GoodsBuyInfo goodsBuyInfo;
    /**
     * 购买的款式的价格
     */
    private int goodsPrice;

    @Override
    public int calculate() {
        int sumAmount = 0;
        //先暂时不带优惠价的计算
        //购买该款式的数量*该款式的价格
        sumAmount = goodsBuyInfo.getBuyNum()*goodsPrice;
        return sumAmount;
    }
}
